local skel = fk.CreateSkill {
  name = "emo__zaji",
}

Fk:loadTranslationTable{
  ["emo__zaji"] = "杂技",
  [":emo__zaji"] = "出牌阶段限一次，你可以摸三张牌然后随机弃置一张牌，若弃置的牌为装备牌，此技能视为未发动。",

  ["#emo__zaji"] = "杂技:你可以摸三张牌然后随机弃置一张牌",
}

skel:addEffect("active", {
  anim_type = "drawcard",
  prompt = "#emo__zaji",
  card_num = 0,
  target_num = 0,
  card_filter = Util.FalseFunc,
  times = function (self, player)
    return 1 - player:usedSkillTimes(skel.name, Player.HistoryPhase)
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    player:drawCards(3, skel.name)
    local cards = table.filter(player:getCardIds("he"), function (id)
      return not player:prohibitDiscard(Fk:getCardById(id))
    end)
    if #cards > 0 then
      local throw = table.random(cards)
      room:throwCard({throw}, skel.name, player, player)
      if Fk:getCardById(throw).type == Card.TypeEquip then
        player:setSkillUseHistory(skel.name, 0, Player.HistoryPhase)
      end
    end
  end,
})

return skel
